# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.WalletObjects.V1.Model.TicketSeat do
  @moduledoc """


  ## Attributes

  *   `coach` (*type:* `String.t`, *default:* `nil`) - The identifier of the train car or coach in which the ticketed seat is located. Eg. "10"
  *   `customFareClass` (*type:* `GoogleApi.WalletObjects.V1.Model.LocalizedString.t`, *default:* `nil`) - A custome fare class to be used if no `fareClass` applies. Both `fareClass` and `customFareClass` may not be set.
  *   `fareClass` (*type:* `String.t`, *default:* `nil`) - The fare class of the ticketed seat.
  *   `seat` (*type:* `String.t`, *default:* `nil`) - The identifier of where the ticketed seat is located. Eg. "42". If there is no specific identifier, use `seatAssigment` instead.
  *   `seatAssignment` (*type:* `GoogleApi.WalletObjects.V1.Model.LocalizedString.t`, *default:* `nil`) - The passenger's seat assignment. Eg. "no specific seat". To be used when there is no specific identifier to use in `seat`.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :coach => String.t() | nil,
          :customFareClass => GoogleApi.WalletObjects.V1.Model.LocalizedString.t() | nil,
          :fareClass => String.t() | nil,
          :seat => String.t() | nil,
          :seatAssignment => GoogleApi.WalletObjects.V1.Model.LocalizedString.t() | nil
        }

  field(:coach)
  field(:customFareClass, as: GoogleApi.WalletObjects.V1.Model.LocalizedString)
  field(:fareClass)
  field(:seat)
  field(:seatAssignment, as: GoogleApi.WalletObjects.V1.Model.LocalizedString)
end

defimpl Poison.Decoder, for: GoogleApi.WalletObjects.V1.Model.TicketSeat do
  def decode(value, options) do
    GoogleApi.WalletObjects.V1.Model.TicketSeat.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.WalletObjects.V1.Model.TicketSeat do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
